<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>home</title>
</head>
<script>
    $(function () {
        $.ajax({
            url: "/user/listDept",
            type: "post",
            data: "",
            dataType: "json",
            success: function (data) {
                var html = '<option value="-1">请选择</option>';
                for (var i = 0; i < data.length; i++) {
                    html += '<option value="' + data[i].id + '">' + data[i].name + '</option>';
                }
                $("#deptId").append(html);
            }
        });
    });

    $(function () {
        $("#deptId").change(function () {
            $("#makeUsers").empty();
            $.ajax({
                url: "/user/getUserByDeptId",
                type: "get",
                data: {"deptId":$("#deptId").val()},
                dataType: "json",
                success: function (data) {
                    // alert(data);
                    var html = '抄送人：';
                    for (var i = 0; i < data.length; i++) {
                        html += '<input type="checkbox" ' + data[i].id + '="" name="makeUsers">'+ data[i].realName;
                    }
                    $("#makeUsers").append(html);
                }
            });
        })
    });
</script>
<body>
<%--<jsp:include page="/html/common/top.jsp"></jsp:include>--%>
<%@include file="/html/common/top.jsp" %>
<%@include file="/html/common/menu.jsp" %>
<div id="right">

    <form action="/meeting/addMeeting" method="post">

        标题：<input name="title" type="text" value=""></br></br>

        选择部门：
        <select id="deptId" name="deptId">

        </select></br></br>

        <div id="makeUsers">抄送人：</div></br></br>

        开始时间：<input type="datetime-local" name="startTime"></br></br>
        结束时间：<input type="datetime-local" name="endTime"></br></br>
        会议内容：<textarea rows="5" cols="20" name="content"></textarea></br></br>
        <input type="reset" value="重置">
        <input type="submit" value="保存">
    </form>

</div>

</body>
</html>
